<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>技术成果管理</title>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
    />
    <link
      rel="stylesheet"
      href="../../layuiadmin/layui/css/layui.css"
      media="all"
    />
    <link
      rel="stylesheet"
      href="../../layuiadmin/style/admin.css"
      media="all"
    />
    <link
      rel="stylesheet"
      href="../../layuiadmin/style/style.css"
      media="all"
    />
    <link
    rel="stylesheet"
    href="../../layuiadmin/fonts/iconfont.css"
    media="all"
  />
  </head>
  <style>
    .layui-form-label {
      width: 95px;
    }
    .layui-input-block {
      margin-left: 125px;
    }
  </style>
  <body>
    <div class="layui-fluid">
        <div class="layui-tab technicalRevieAgenda" lay-filter="technicalRevieAgenda">
          <div class="technicalReviewHeader">
            <div
              class="layui-form layuiadmin-card-header-auto"
              lay-filter="layuiadmin-app-form-list"
            >
              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label">编号:</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="no"
                      id="no"
                      autocomplete="off"
                      class="layui-input"
                    />
                  </div>
                </div>
                <div class="layui-inline">
                  <label class="layui-form-label">名称:</label>
                  <div class="layui-input-block">
                    <input
                      type="text"
                      name="projectName"
                      id="projectName"
                      autocomplete="off"
                      class="layui-input"
                    />
                  </div>
                </div>
                <div class="layui-inline">
                  <button
                    class="layui-btn conditionalSearch"
                    lay-submit
                    lay-filter="LAY-user-back-search"
                  >
                    <i class="layui-icon layui-icon-search"></i>
                    搜索
                  </button>
                  <button
                    class="layui-btn conditionalEmpty"
                    lay-submit
                    lay-filter="LAY-user-back-clear"
                  >
                    <i class="layui-icon layui-icon-close"></i>
                    清空
                  </button>
                </div>
              </div>
            </div>
          </div>
            <ul class="layui-tab-title">
              <li class="layui-this" lay-id="0">
                <i class="iconfont icon-daiban1"></i>
                技审待办<span id="reviewBacklogSum"></span>项
              </li>
              <li lay-id="1"><i class="iconfont icon-yibanshixiang-16px"></i>
                技审已办<span id="reviewDonelogSum"></span>项</li>
            </ul>
            <div class="layui-tab-content">
              <div class="layui-tab-item layui-show">
              <div
                  class="layui-tab layui-tab-card technicalRevieTab"
                  lay-filter="technicalRevieTab0"
                >
                  <ul class="layui-tab-title">
                    <li data-status="1" lay-id="1">
                      监护大纲<span class="TheOutlineCount"></span>
                    </li>
                    <li data-status="2" lay-id="2">
                      技术审查（征询）<span class="reviewConsult"></span>
                    </li>
                    <li data-status="3" lay-id="3">
                      技术审查（许可）<span class="reviewLicensing"></span>
                    </li>
                    <li data-status="4" lay-id="4">
                      专项保护方案 <span class="protectionPlan"></span>
                    </li>
                    <li data-status="5" lay-id="5">结合改造</li>
                  </ul>
                  <div class="layui-tab-content">
                    <!-- 监护大纲 -->
                    <div class="layui-tab-item">
                      <table
                        id="guardianshipProgram01"
                        lay-filter="guardianshipProgram01"
                      ></table>
                      <script type="text/html" id="guardianshipOpera01">
                        <a
                          class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                          lay-event="guardianTechnicalRequirement"
                          style="margin-right:10px; "
                          >技术要求</a
                        >
                        {{# if(layui.sessionData("status").key === "1" && d.pendingState
                        === "1"|| layui.sessionData("status").key === "1" &&
                        d.pendingState === "3"||layui.sessionData("status").key ===
                        "1"&& d.pendingState === "5"||layui.sessionData("status").key
                        === "1" && d.pendingState === "6" ){ }}
                        <button
                          class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement layui-btn-disabled"
                          style="margin-right:10px;"
                          lay-event="technicalRequirement"
                          disabled="true"
                        >
                          监护大纲
                        </button>

                        {{# } else { }}
                        <a
                          class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement"
                          style="margin-right:10px;"
                          lay-event="technicalRequirement"
                          >监护大纲</a
                        >
                        {{# } }}
                        <a
                          class="layui-btn layui-btn-xs technicalReviewBtn outlineGeneration"
                          lay-event="guardianshipAuditView"
                          >审核查看</a
                        >
                        <div class="technicalOperate"></div>
                      </script>
                    </div>
                    <!-- 技术审查（征询）2 -->
                    <div class="layui-tab-item">
                      <table
                        id="technicalReConsultation02"
                        lay-filter="technicalReConsultation02"
                      ></table>
                      <script type="text/html" id="technicalReConsultationOprea02">
                        <div class="technicalOperate">
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn holdMeeting"
                            lay-event="zxholdMeeting"
                            style="width:100%; "
                            >会议召开</a
                          >
                        </div>
                        <div class="technicalOperate">
                          {{# if(layui.sessionData("status").key == "2" &&
                          d.pendingState === '5'||layui.sessionData("status").key ==
                          "2"&&d.flowStatus === '4'){ }}
                          <button
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee layui-btn-disabled"
                            lay-event="zxtechnicalReviewOpinions"
                            disabled="true"
                          >
                            技审意见生成
                          </button>
                          {{# } else { }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                            lay-event="zxtechnicalReviewOpinions"
                            >技审意见生成</a
                          >
                          {{# } }} {{# if(layui.sessionData("status").key ==
                          "2"&&d.flowStatus === '1'){ }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement layui-btn-disabled"
                            >技审意见查看</a
                          >
                          {{# } else { }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement"
                            lay-event="zxtechnicalRequirement"
                            >技审意见查看</a
                          >
                          {{# } }} {{# if(layui.sessionData("status").key == "2"&&
                          d.flowStatus === '1'||layui.sessionData("status").key ==
                          "2"&&d.flowStatus ==='4'){ }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn outlineGeneration layui-btn-disabled"
                          >
                            技审草稿上传
                          </a>
                          {{# } else { }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn outlineGeneration"
                            lay-event="zxdraftUpload"
                          >
                            技审草稿上传
                          </a>
                          {{# } }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn additionalInformation"
                            lay-event="zxadditionalInformation"
                            >补充资料上传</a
                          >
                        </div>
                      </script>
                    </div>
                    <!-- 技术审查（许可）1 -->
                    <div class="layui-tab-item layui-show">
                      <table id="technicalReview03" lay-filter="technicalReview03"></table>
                      <script type="text/html" id="technicalReviewOprea03">
                        <div class="technicalOperate">
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn holdMeeting"
                            lay-event="holdMeeting"
                            style="width:100%; "
                            >会议召开</a
                          >
                        </div>
                        <div class="technicalOperate technicalOperatee">
                          {{# if(layui.sessionData("status").key == "3" &&
                          d.pendingState === '5'||layui.sessionData("status").key == "3"
                          &&d.pendingState === '4'){ }}
                          <button
                            class="layui-btn layui-btn-xs layui-btn-disabled technicalReviewBtn technicalReviewSee"
                            lay-event="technicalReviewOpinions"
                            disabled="true"
                          >
                            技审意见生成
                          </button>
                          {{# } else { }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                            lay-event="technicalReviewOpinions"
                            >技审意见生成</a
                          >
                          {{# } }} {{# if(layui.sessionData("status").key ==
                          "3"&&d.pendingState === '1'){ }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement layui-btn-disabled"
                            >技审意见查看</a
                          >
                          {{# } else { }}
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement"
                            lay-event="technicalRequirement"
                            >技审意见查看</a
                          >
                          {{# } }} {{# if(layui.sessionData("status").key ==
                          "3"&&d.pendingState === '1'||layui.sessionData("status").key
                          == "3" &&d.pendingState === '4'){ }}
                          <button
                            class="layui-btn layui-btn-xs layui-btn-disabled technicalReviewBtn outlineGeneration"
                            lay-event="draftUpload"
                            disabled="true"
                          >
                            技审草稿上传
                          </button>
                          {{# } else { }}
                          <button
                            class="layui-btn layui-btn-xs technicalReviewBtn outlineGeneration"
                            lay-event="draftUpload"
                          >
                            技审草稿上传
                          </button>
                          {{# } }}

                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn additionalInformation"
                            lay-event="additionalInformation"
                            >补充资料上传</a
                          >
                        </div>
                      </script>
                    </div>
                    <!-- 专项保护方案 -->
                    <div class="layui-tab-item">
                      <table
                        id="protectionScheme04"
                        lay-filter="protectionScheme04"
                      ></table>
                      <script type="text/html" id="protectionSchemeOprea04">
                        <a
                          class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                          lay-event="specialProSchemeView"
                          >查看</a
                        >

                        {{# if(layui.sessionData("status").key == "4" &&d.pendingState
                        === '8'){ }}
                        <button
                          class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement layui-btn-disabled"
                          lay-event="planPassed"
                          disabled="true"
                        >
                          通过
                        </button>
                        <button
                          class="layui-btn layui-btn-xs technicalReviewBtn outlineGeneration layui-btn-disabled"
                          lay-event="planReturn"
                          disabled="true"
                        >
                          退回
                        </button>
                        {{# } else { }}
                        <a
                          class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement"
                          lay-event="planPassed"
                          >通过</a
                        >
                        <a
                          class="layui-btn layui-btn-xs technicalReviewBtn outlineGeneration"
                          lay-event="planReturn"
                          >退回</a
                        >
                        {{# } }}
                      </script>
                    </div>
                    <!-- 结合改造 -->
                    <div class="layui-tab-item">
                      <table
                        id="combinedTransformation05"
                        lay-filter="combinedTransformation05"
                        lay-skin="nob"
                      ></table>
                      <script type="text/html" id="combinedTransformationOpra05">
                        <div class="technicalOperate">
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn holdMeeting"
                            lay-event="del"
                            style="width:100%; "
                            >资料上传</a
                          >
                        </div>
                        <div class="technicalOperate">
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                            lay-event="del"
                            style="margin-right:10px; "
                            >技术要求</a
                          >
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn technicalRequirement"
                            style="margin-right:10px;"
                            lay-event="guardianshipProgram"
                            >监护大纲</a
                          >
                          <a
                            class="layui-btn layui-btn-xs technicalReviewBtn outlineGeneration"
                            lay-event="edit"
                            >审核查看</a
                          >
                        </div>
                      </script>
                    </div>
                  </div>
                </div>
              </div>
              <div class="layui-tab-item"><div
                class="layui-tab layui-tab-card technicalRevieTab"
                lay-filter="technicalRevieTab1"
              >
                <ul class="layui-tab-title">
                  <li data-status="1" lay-id="1">
                    监护大纲<span class="TheOutlineCount"></span>
                  </li>
                  <li data-status="2" lay-id="2">
                    技术审查（征询）<span class="reviewConsult"></span>
                  </li>
                  <li data-status="3" lay-id="3">
                    技术审查（许可）<span class="reviewLicensing"></span>
                  </li>
                  <li data-status="4" lay-id="4">
                    专项保护方案 <span class="protectionPlan"></span>
                  </li>
                  <li data-status="5" lay-id="5">结合改造</li>
                </ul>
                <div class="layui-tab-content">
                  <!-- 监护大纲 -->
                  <div class="layui-tab-item">
                    <table
                      id="guardianshipProgram11"
                      lay-filter="guardianshipProgram11"
                    ></table>
                    <script type="text/html" id="selectTypeOpea11">
                      {{# if(layui.sessionData("status").key == "1" &&d.pendingState
                        === '7'){ }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                        lay-event="specialProSchemeView"
                        >技审终稿查看</button
                      >
                      {{# } else { }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee layui-btn-disabled"
                        disabled="true"
                        >技审终稿查看</button
                      >
                      {{# } }}
                    </script>
                  </div>
                  <!-- 技术审查（征询）2 -->
                  <div class="layui-tab-item">
                    <table
                      id="technicalReConsultation12"
                      lay-filter="technicalReConsultation12"
                    ></table>
                    <script type="text/html" id="selectTypeOpea12">
                      {{# if(layui.sessionData("status").key == "2" &&d.pendingState
                        === '6'){ }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                        lay-event="specialProSchemeView"
                        >技审终稿查看</button
                      >
                      {{# } else { }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee layui-btn-disabled"
                        disabled="true"
                        >技审终稿查看</button
                      >
                      {{# } }}
                    </script>
                  </div>
                  <!-- 技术审查（许可）1 -->
                  <div class="layui-tab-item layui-show">
                    <table id="technicalReview13" lay-filter="technicalReview13"></table>
                    <script type="text/html" id="selectTypeOpea13">
                      {{# if(layui.sessionData("status").key == "3" &&d.pendingState
                        === '6'){ }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                        lay-event="specialProSchemeView"
                        >技审终稿查看</button
                      >
                      {{# } else { }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee layui-btn-disabled"
                        disabled="true"
                        >技审终稿查看</button
                      >
                      {{# } }}
                    </script>
                  </div>
                  <!-- 专项保护方案 -->
                  <div class="layui-tab-item">
                    <table
                      id="protectionScheme14"
                      lay-filter="protectionScheme14"
                    ></table>
                    <script type="text/html" id="selectTypeOpea14">
                      {{# if(layui.sessionData("status").key == "4" &&d.pendingState
                        === '9'){ }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                        lay-event="specialProSchemeView"
                        >技审终稿查看</button
                      >
                      {{# } else { }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee layui-btn-disabled"
                        disabled="true"
                        >技审终稿查看</button
                      >
                      {{# } }}
                    </script>
                  </div>
                  <!-- 结合改造 -->
                  <div class="layui-tab-item">
                    <table
                      id="combinedTransformation15"
                      lay-filter="combinedTransformation15"
                      lay-skin="nob"
                    ></table>
                    <script type="text/html" id="selectTypeOpea15">
                      {{# if(layui.sessionData("status").key == "5" &&d.pendingState
                        === '6'){ }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee"
                        lay-event="specialProSchemeView"
                        >技审终稿查看</button
                      >
                      {{# } else { }}
                      <button
                        class="layui-btn layui-btn-xs technicalReviewBtn technicalReviewSee layui-btn-disabled"
                        disabled="true"
                        >技审终稿查看</button
                      >
                      {{# } }}
                    </script>
                  </div>
                </div>
              </div>
            </div>
        </div>
    </div>
    <div class="Popup projectTypeSelect">
      <i class="layui-icon layui-icon-close closeBtn"></i>
      <h3>项目类型</h3>
      <div class="projectType">
        <form class="layui-form" action="" id="projectTypeForm">
          <div class="layui-form-item">
            <label class="layui-form-label">项目类型:</label>
            <div class="layui-input-block" style="text-align: left">
              <select name="type" lay-filter="projectType" id="projectType">
                <option value=""></option>
              </select>
            </div>
          </div>
          <div class="layui-form-item pipeline">
            <label class="layui-form-label">管线:</label>
            <div class="layui-input-block" style="text-align: left">
              <select name="pipeline" lay-filter="pipeline" id="pipeline">
                <option value="">请选择</option>
                <option value="1">是</option>
                <option value="0">否</option>
              </select>
            </div>
          </div>
          <div class="layui-form-item pipelineType">
            <label class="layui-form-label">管线类型:</label>
            <div class="layui-input-block">
              <div id="pipelineType"></div>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">线路情况:</label>
            <div class="layui-input-block" style="text-align: left">
              <input
                type="checkbox"
                name="lineType"
                title="运营"
                lay-skin="primary"
                value="1"
              />
              <input
                type="checkbox"
                name="lineType"
                title="在建"
                lay-skin="primary"
                value="2"
              />
              <input
                type="checkbox"
                name="lineType"
                title="规划"
                lay-skin="primary"
                value="3"
              />
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">车站:</label>
            <div class="layui-input-block" style="text-align: left">
              <input
                type="checkbox"
                name="stationFlag"
                lay-skin="primary"
                value="1"
                title="地上"
              />
              <input
                type="checkbox"
                name="stationFlag"
                lay-skin="primary"
                value="2"
                title="地下"
              />
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">区间:</label>
            <div class="layui-input-block" style="text-align: left">
              <input
                type="checkbox"
                name="stationArea"
                lay-skin="primary"
                value="1"
                title="单圆"
              />
              <input
                type="checkbox"
                name="stationArea"
                lay-skin="primary"
                value="2"
                title="双圆"
              />
              <input
                type="checkbox"
                name="stationArea"
                lay-skin="primary"
                value="3"
                title="矩形"
              />
              <input
                type="checkbox"
                name="stationArea"
                lay-skin="primary"
                value="4"
                title="高架"
              />
              <input
                type="checkbox"
                name="stationArea"
                lay-skin="primary"
                value="5"
                title="地面"
              />
            </div>
          </div>
          <div class="PopupBotmBtn">
            <div>
              <a class="sureBtn projectTypeBtn" id="pipelineForm">确定</a>
            </div>
            <div>
              <button
                type="button"
                class="layui-btn cancelBtn"
                lay-submit=""
                lay-filter="cancelBtn"
              >
                取消
              </button>
            </div>
          </div>
        </form>
      </div>
    </div>
    <div class="Popup draftUpload">
      <i class="layui-icon layui-icon-close closeBtn"></i>
      <h3>技审草稿上传</h3>
      <div class="fileUploadDrag">
        <div class="layui-upload-drag" id="fileUpload">
          <i class="layui-icon"></i>
          <p>点击上传，或将文件拖拽到此处(仅word文件)</p>
          <div class="layui-hide" id="uploadDemoView">
            <hr />
            <div class="fileUploadName"></div>
          </div>
        </div>
        <div class="fileUploadDelete"></div>
        <button class="layui-btn layui-btn-xs fileUploadButton">上传</button>
        <div class="PopupBotmBtn">
          <div>
            <button
              type="button"
              class="layui-btn projectTypeBtn cancelBtn"
              lay-submit=""
              lay-filter="draftUploadCancel"
              id="draftUploadCancel"
            >
              取消
            </button>
          </div>
          <div>
            <a class="sureBtn fileUploadBtn" lay-href="#">确定</a>
          </div>
        </div>
      </div>
    </div>
    <div class="Popup additionInformation">
      <i class="layui-icon layui-icon-close closeBtn"></i>
      <h3>补充资料上传</h3>
      <div class="fileUploadDrag">
        <div class="layui-upload-drag" id="additionFileUpload">
          <i class="layui-icon"></i>
          <p>点击上传，或将文件拖拽到此处</p>
          <div class="layui-hide" id="uploadDemoVieww">
            <hr />
            <div class="fileUploadName"></div>
          </div>
        </div>
        <div class="additionInformationDelete"></div>
        <button class="layui-btn layui-btn-xs addfileUploadButton">上传</button>
        <div class="PopupBotmBtn">
          <div>
            <button
              type="button"
              class="layui-btn projectTypeBtn cancelBtn"
              lay-submit=""
              lay-filter="additionInformationCancel"
              id="additionInformationCancel"
            >
              取消
            </button>
          </div>
          <div>
            <a class="sureBtn additionalInformationBtn" lay-href="#">确定</a>
          </div>
        </div>
      </div>
    </div>
    <div class="Popup specialProtection">
      <i class="layui-icon layui-icon-close closeBtn"></i>
      <h3>技审草稿专项保护方案</h3>
      <div class="specialProtectionCon">
        <form class="layui-form" action="" id="specialProtection">
          <div class="layui-form-item">
            <label class="layui-form-label">技审草稿</label>
            <div class="layui-input-block">
              <select
                name="reviewStatus"
                id="technicalReviewDraft"
                lay-filter="technicalReviewDraft"
                data-key=""
              ></select>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">专项保护方案</label>
            <div class="layui-input-block">
              <div class="layui-col-md10">
                <select
                  name="reviewStatus"
                  id="specialProtectionScheme"
                  lay-filter="specialProtectionScheme"
                  data-key=""
                ></select>
              </div>
              <div
                class="layui-col-md2"
                style="line-height: 38px; text-align: center; font-size: 16px"
              >
                <a class="specialProtectionSchemeSee">查看</a>
              </div>
            </div>
          </div>
          <div class="PopupBotmBtn">
            <div>
              <button
                type="button"
                class="layui-btn projectTypeBtn cancelBtn"
                lay-submit=""
                lay-filter="specialProtectionCance"
              >
                取消
              </button>
            </div>
            <div>
              <a class="sureBtn specialProtectionConSure">确定</a>
            </div>
          </div>
        </form>
      </div>
    </div>
    <div class="Popup returnComments">
      <i class="layui-icon layui-icon-close closeBtn"></i>
      <h3>退回意见</h3>
      <div class="returnCommentsCon">
        <form class="layui-form" action="" id="returnComments">
          <div class="layui-form-item">
            <textarea
              placeholder="请输入退回意见"
              class="layui-textarea"
            ></textarea>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">审核人:</label>
              <div class="layui-input-inline">
                <input
                  type="text"
                  name="name"
                  autocomplete="off"
                  class="layui-input"
                  id="reviewer"
                />
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">联系方式:</label>
              <div class="layui-input-inline">
                <input
                  type="tel"
                  name="phone"
                  autocomplete="off"
                  class="layui-input"
                  value="xxxxx"
                />
              </div>
            </div>
          </div>
          <div class="PopupBotmBtn">
            <div>
              <button
                type="button"
                class="layui-btn projectTypeBtn cancelBtn"
                lay-submit=""
                lay-filter=""
              >
                取消
              </button>
            </div>
            <div>
              <a class="sureBtn additionalInformationBtnn">确定</a>
            </div>
          </div>
        </form>
      </div>
    </div>
    <script type="text/html" id="consultTechnicalReview">
      <form class="layui-form" action="" id="projectTypeSelectForm">
        <div class="layui-form-item">
          <label class="layui-form-label">项目类型:</label>
          <div class="layui-input-block">
            <select name="type" id="typeA" lay-verify="required">
              <option value="">请选择</option>
              <option value="1">建筑类</option>
            </select>
          </div>
        </div>
      </form>
      <!-- <div class="layui-form-item layui-hide">
        <div class="layui-input-block">
          <button
            class="layui-btn"
            lay-submit
            lay-filter="projectTypeSubmit"
            id="projectTypeSubmit"
          >
            提交
          </button>
        </div>
      </div> -->
    </script>

    <div id="file_upload_div" style="display: none" class="text-center">
      <div class="layui-upload-drag" id="test10">
        <i class="layui-icon"></i>
        <p>点击上传，或将文件拖拽到此处</p>
      </div>
      <div class="mt-2 mb-2" id="file_name"></div>
      <div class="row w-100"></div>
      <button type="button" class="layui-btn mt-2" id="upload">开始上传</button>
    </div>
    <div id="returnCommentsxxx" style="display: none">
      <form class="layui-form">
        <div class="layui-form-item">
          <textarea placeholder="" class="layui-textarea" id="commentsTxt">
专项保护方案内容有误，请修改后重新提交。</textarea
          >
        </div>
        <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">审核人:</label>
            <div class="layui-input-inline">
              <input
                id="specialAuditor"
                type="text"
                name="name"
                autocomplete="off"
                class="layui-input"
              />
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">联系方式:</label>
            <div class="layui-input-inline">
              <input
                id="contact"
                type="tel"
                name="phone"
                autocomplete="off"
                class="layui-input"
                value="xxxxx"
              />
            </div>
          </div>
        </div>
      </form>
    </div>
    <script type="text/html" id="meetAddressSelect">
      <div class="meetingSelection">
        <div class="onlineMeeting">
          <div class="selectionBox">
            <img src="../../layuiadmin/images/online.png" />
          </div>
          <h4>线上会议</h4>
        </div>
        <div class="offlineMeeting">
          <div class="selectionBox">
            <img src="../../layuiadmin/images/offline.png" />
          </div>
          <h4>线下会议</h4>
        </div>
        <div class="layui-form-item layui-hide">
          <input
            type="button"
            lay-submit
            lay-filter="recordSubmit"
            id="recordSubmit"
            value="确认添加"
          />
          <input
            type="button"
            lay-submit
            lay-filter="layuiadmin-app-form-edit"
            id="layuiadmin-app-form-edit"
            value="确认编辑"
          />
        </div>
      </div>
    </script>
    <!-- 会议信息||添加会议 -->
    <script type="text/html" id="addMeetingForm">
      <form lay-filter="addMeetingForm" class="layui-form model-form">
        <input name="type" id="type" type="hidden" />
        <div class="layui-form-item">
          <label class="layui-form-label requiredLabel">会议名称</label>
          <div class="layui-input-block">
            <input
              name="meetingHeadline"
              type="text"
              class="layui-input"
              autocomplete="off"
              id="meetingHeadline"
              lay-verify="required"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label changeTimeOrAdd requiredLabel"
            >会议时间/地点</label
          >
          <div class="layui-input-block">
            <div id="meetingTime"></div>
            <input
              type="text"
              class="layui-input"
              id="meetingDate"
              autocomplete="off"
              lay-verify="required"
              name="meetingDate"
              lay-verify="required"
              style="position: relative;"
            />
            <input type="hidden" id="appointmentDate" value="6,7" />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label requiredLabel">会议议程</label>
          <div class="layui-input-block">
            <textarea
              class="layui-textarea"
              name="content"
              id="meetingContent"
              lay-verify="required"
            >
1.项目方案讨论会</textarea
            >
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label requiredLabel">会议召集</label>
          <div class="layui-input-block">
            <input
              type="text"
              class="layui-input"
              name="orgUserNumber"
              autocomplete="off"
              id="orgUserNumber"
              lay-verify="required"
            />
          </div>
        </div>
        <div class="layui-form-item layui-form-text">
          <label class="layui-form-label requiredLabel">参会人员</label>
          <div class="layui-input-block">
            <div id="participantsN" class="xm-select-demo"></div>
          </div>
        </div>
        <div class="layui-form-item layui-form-text">
          <label class="layui-form-label"></label>
          <div class="layui-input-block">
            <div id="participantsW" class="xm-select-demo"></div>
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">会议备注</label>
          <div class="layui-input-block">
            <textarea class="layui-textarea" name="remarks"></textarea>
          </div>
        </div>
        <div class="layui-form-item meetingScheduleBtn">
          <button
            class="layui-btn meetingNotice layui-btn-disabled"
            type="button"
            disabled="disabled"
          >
            会议通知单
          </button>
          <button
            class="layui-btn enterMeeting"
            type="button"
            lay-filter="formSubmit"
            lay-submit
          >
            确定
          </button>
        </div>
      </form>
    </script>
    <script type="text/html" id="changeTimeForm">
      <div class="changeTimeAddBox" style="height: 240px;">
        <div class="changeTimeBar" style="margin-left: 20px;">
          <ul></ul>
        </div>
      </div>
    </script>
    <script type="text/html" id="outChangeTimeForm">
      <form class="layui-form" action="" lay-filter="layuiadmin-app-form-list">
        <select
          name="reviewStatus"
          class="changeAddress"
          id="changeAddress"
          lay-filter="changeAddressFilter"
        >
          <option value="0"></option>
        </select>
      </form>
      <div class="changeTimeAddBox">
        <div class="changeAddBar"></div>
        <div class="changeTimeBar"><ul></ul></div>
      </div>
    </script>
    <!-- 技审意见生成项目类型 -->
    <script type="text/html" id="projectTypeSelect">
      <form class="layui-form" action="" id="projectTypeForm">
        <div class="layui-form-item">
          <label class="layui-form-label">项目类型:</label>
          <div class="layui-input-block">
            <select name="type" lay-filter="projectType" id="projectType">
              <option value=""></option>
            </select>
          </div>
        </div>
        <div class="layui-form-item pipeline">
          <label class="layui-form-label">管线:</label>
          <div class="layui-input-block">
            <select name="pipeline" lay-filter="pipeline" id="pipeline">
              <option value="">请选择</option>
              <option value="1">是</option>
              <option value="0">否</option>
            </select>
          </div>
        </div>
        <div class="layui-form-item pipelineType">
          <label class="layui-form-label">管线类型:</label>
          <div class="layui-input-block">
            <div id="pipelineType"></div>
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">线路情况:</label>
          <div class="layui-input-block" style="text-align: left">
            <input
              type="checkbox"
              name="lineType"
              title="运营"
              lay-skin="primary"
              value="1"
            />
            <input
              type="checkbox"
              name="lineType"
              title="在建"
              lay-skin="primary"
              value="2"
            />
            <input
              type="checkbox"
              name="lineType"
              title="规划"
              lay-skin="primary"
              value="3"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">车站:</label>
          <div class="layui-input-block" style="text-align: left">
            <input
              type="checkbox"
              name="stationFlag"
              lay-skin="primary"
              value="1"
              title="地上"
            />
            <input
              type="checkbox"
              name="stationFlag"
              lay-skin="primary"
              value="2"
              title="地下"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">区间:</label>
          <div class="layui-input-block" style="text-align: left">
            <input
              type="checkbox"
              name="stationArea"
              lay-skin="primary"
              value="1"
              title="单圆"
            />
            <input
              type="checkbox"
              name="stationArea"
              lay-skin="primary"
              value="2"
              title="双圆"
            />
            <input
              type="checkbox"
              name="stationArea"
              lay-skin="primary"
              value="3"
              title="矩形"
            />
            <input
              type="checkbox"
              name="stationArea"
              lay-skin="primary"
              value="4"
              title="高架"
            />
            <input
              type="checkbox"
              name="stationArea"
              lay-skin="primary"
              value="5"
              title="地面"
            />
          </div>
        </div>
        <div class="PopupBotmBtn">
          <div>
            <button
              type="button"
              class="layui-btn cancelBtn"
              lay-submit=""
              lay-filter="cancelBtn"
            >
              取消
            </button>
          </div>
          <div>
            <a class="sureBtn projectTypeBtn" id="pipelineForm">确定</a>
          </div>
        </div>
      </form>
    </script>
    <script src="../../layuiadmin/modules/const_config.js"></script>
    <script src="../../layuiadmin/modules/jTools.js"></script>
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script>
      layui
        .config({
          base: "../../layuiadmin/", //静态资源所在路径
        })
        .extend({
          index: "lib/index", //主入口模块
          xmSelect: "xm-select",
        })
        .use(
          [
            "index",
            "comment",
            "contlist",
            "table",
            "upload",
            "xmSelect",
            "laydate",
            "element",
          ],
          function () {
            var table = layui.table,
              $ = layui.$,
              upload = layui.upload,
              xmSelect = layui.xmSelect,
              laydate = layui.laydate,
              element = layui.element,
              form = layui.form,
              upLoadId = "",
              upLoadIdd = "",
              fileUploadUploadRender = "",
              fresh_link = new Date().getTime(),
              result = [],
              selectedDataList = [],
              changeMeetingAdress = "",
              flagg = "",
              participantsNSelect = "",
              participantsWSelect = "",
              infoData = true,
              infoDataa = true,
              indexItemm = [],
              indexItem = [],
              indexLength = 0;
            // var loadIndex = layer.load(1, { time: 1 * 1000, shade: 0.6 });
            $(".noticeMeetingTotal").html(
              layui.sessionData("noticeMeetingLength").key
            );
            function renderData() {
              $(".changeTimeBar ul").html();
              var html = "";
              var timePoint = [
                "08:00",
                "08:30",
                "09:00",
                "09:30",
                "10:00",
                "10:30",
                "11:00",
                "11:30",
                "12:00",
                "12:30",
                "13:00",
                "13:30",
                "14:00",
                "14:30",
                "15:00",
                "15:30",
                "16:00",
                "16:30",
                "17:00",
                "17:30",
                "18:00",
              ];
              for (var i = 0; i < timePoint.length; i++) {
                html += '<button  type="button">' + timePoint[i] + "</button>";
              }
              $(".changeTimeBar ul").html(html);
              // let indexItemm = [];
              let indexDataa = [];
              let timeItemm = [];
              $(".changeTimeBar ul button").on("click", function () {
                let valueText = $(this).text();
                let indexId = $(this).index();
                indexItemm.push(valueText);
                indexDataa.push(indexId);

                if (indexItemm.length == 1) {
                  $(this).css("background-color", "#e79e4c");
                } else if (indexItemm.length == 2) {
                  indexDataa.sort((a, b) => {
                    return a - b;
                  });
                  console.log(indexDataa);
                  var arr = timePoint.slice(indexDataa[0] + 1, indexDataa[1]);
                  var ffd = arr.map((item, index) => {
                    return timeItemm.includes(item);
                  });

                  console.log(ffd);

                  if (ffd.indexOf(true) > -1) {
                    var startIndex = indexDataa[0];
                    var endIndex = indexDataa[1];
                    $(".changeTimeBar ul button")
                      .eq(startIndex)
                      .css("background-color", "rgb(192, 206, 235)");
                    $(".changeTimeBar ul button")
                      .eq(endIndex)
                      .css("background-color", "rgb(192, 206, 235)");
                    indexItem.length = 0;
                    indexDataa.length = 0;
                    indexItem.push(valueText);
                    indexDataa.push(indexId);
                    $(this).css("background-color", "#e79e4c");
                  } else {
                    var startIndex = indexDataa[0];
                    var endIndex = indexDataa[1];
                    getIndex(startIndex, endIndex + 1);
                  }
                } else {
                  var startIndex = indexDataa[0];
                  var endIndex = indexDataa[1];
                  clearIndex(startIndex, endIndex + 1);

                  indexItemm.length = 0;
                  indexDataa.length = 0;
                  indexItemm.push(valueText);
                  indexDataa.push(indexId);
                  $(this).css("background-color", "#e79e4c");
                }

                function getIndex(startIndex, endIndex) {
                  if (startIndex < endIndex) {
                    $(".changeTimeBar ul button")
                      .eq(startIndex)
                      .css("background-color", "#e79e4c");
                    startIndex++;
                    getIndex(startIndex, endIndex);
                  }
                }
                function clearIndex(startIndex, endIndex) {
                  if (startIndex < endIndex) {
                    $(".changeTimeBar ul button")
                      .eq(startIndex)
                      .css("background-color", "rgb(192, 206, 235)");
                    startIndex++;
                    clearIndex(startIndex, endIndex);
                  }
                }
              });

              $(".changeTimeAdd .closeBtn").on("click", function () {
                $(".changeTimeAdd").hide();
                var chooseAfterValueNew = indexItemm.sort((a, b) => {
                  return a > b ? 1 : -1;
                  // return  a-b
                });
                $("#changeDateS").val(chooseAfterValueNew[0]);
                $("#changeDateE").val(chooseAfterValueNew[1]);
              });
            }

            function renderDatePick(roomKey) {
              $(".changeTimeBar ul").html();
              let times = result[roomKey];
              let timeItem = [];
              var timePoint = [
                "08:00",
                "08:30",
                "09:00",
                "09:30",
                "10:00",
                "10:30",
                "11:00",
                "11:30",
                "12:00",
                "12:30",
                "13:00",
                "13:30",
                "14:00",
                "14:30",
                "15:00",
                "15:30",
                "16:00",
                "16:30",
                "17:00",
                "17:30",
                "18:00",
              ];
              var html = "",
                disabled = false,
                flgVal = true;
              for (var i = 0; i < timePoint.length; i++) {
                let flag = false;
                for (var j = 0; j < times.length; j++) {
                  let time = times[j];
                  flag =
                    timePoint[i] >= time["startTime"] &&
                    timePoint[i] <= time["endTime"];
                  if (flag) {
                    selectedDataList.push(timePoint[i]);
                    break;
                  }
                }
                if (flag) {
                  timeItem.push(timePoint[i]);
                  html +=
                    '<button  type="button" class="active" disabled=' +
                    !disabled +
                    ">" +
                    timePoint[i] +
                    "</button>";
                } else {
                  html +=
                    '<button type="button" >' + timePoint[i] + "</button>";
                }
              }
              $(".changeTimeBar ul").html(html);
              $(".changeAddBar").html(roomKey);
              let chooseAfterValue = [];
              // let indexItem = [];
              let indexData = [];
              $(".changeTimeBar ul button").on("click", function () {
                let valueText = $(this).text();
                let indexId = $(this).index();
                indexItem.push(valueText);
                indexData.push(indexId);

                if (indexItem.length == 1) {
                  $(this).css("background-color", "#e79e4c");
                } else if (indexItem.length == 2) {
                  indexData.sort((a, b) => {
                    return a - b;
                  });
                  console.log(indexData);
                  var arr = timePoint.slice(indexData[0] + 1, indexData[1]);
                  var ffd = arr.map((item, index) => {
                    return timeItem.includes(item);
                  });

                  console.log(ffd);

                  if (ffd.indexOf(true) > -1) {
                    var startIndex = indexData[0];
                    var endIndex = indexData[1];
                    $(".changeTimeBar ul button")
                      .eq(startIndex)
                      .css("background-color", "rgb(192, 206, 235)");
                    $(".changeTimeBar ul button")
                      .eq(endIndex)
                      .css("background-color", "rgb(192, 206, 235)");
                    indexItem.length = 0;
                    indexData.length = 0;
                    indexItem.push(valueText);
                    indexData.push(indexId);
                    $(this).css("background-color", "#e79e4c");
                  } else {
                    var startIndex = indexData[0];
                    var endIndex = indexData[1];
                    getIndex(startIndex, endIndex + 1);
                  }
                } else {
                  var startIndex = indexData[0];
                  var endIndex = indexData[1];
                  clearIndex(startIndex, endIndex + 1);

                  indexItem.length = 0;
                  indexData.length = 0;
                  indexItem.push(valueText);
                  indexData.push(indexId);
                  $(this).css("background-color", "#e79e4c");
                }

                function getIndex(startIndex, endIndex) {
                  if (startIndex < endIndex) {
                    $(".changeTimeBar ul button")
                      .eq(startIndex)
                      .css("background-color", "#e79e4c");
                    startIndex++;
                    getIndex(startIndex, endIndex);
                  }
                }
                function clearIndex(startIndex, endIndex) {
                  if (startIndex < endIndex) {
                    $(".changeTimeBar ul button")
                      .eq(startIndex)
                      .css("background-color", "rgb(192, 206, 235)");
                    startIndex++;
                    clearIndex(startIndex, endIndex);
                  }
                }
              });
              $(".changeTimeAdd .closeBtn").on("click", function () {
                $(".changeTimeAdd").hide();
                var chooseAfterValueNew = indexItem.sort((a, b) => {
                  return a > b ? 1 : -1;
                  // return  a-b
                });
                $("#changeDateS").val(chooseAfterValueNew[0]);
                $("#changeDateE").val(chooseAfterValueNew[1]);
                $("#changeDateA").val($("#changeAddress").text().trim());
              });
            }
            var pipelinesortSelect = xmSelect.render({
              el: "#pipelineType",
              name: "pipelinesort",
              theme: {
                color: "#334d80",
              },
              language: "zn",
              data: [
                { name: "顶管", value: 3 },
                { name: "拖拉管", value: 2 },
                { name: "开槽埋管", value: 1 },
                { name: "工作井围护", value: 4 },
              ],
            });
            //待办描述
            $.ajax({
              type: "post",
              async: true, //异步执行
              url: base_url + "/report/getTodoStatusList",
              headers: {
                Accept: "application/json; charset=utf-8",
                Authorization: layui.sessionData("userToken").key,
              },
              contentType: "application/json",
              data: JSON.stringify({}),
              success: function (data) {
                $.each(data.data.todomap, function (index, item) {
                  $("#reviewStatus").append(new Option(item, index));
                });
                form.render("select");
              },
            });
            // 项目类型选择
            $.ajax({
              type: "get",
              async: false, //异步执行
              url: base_url + "/Technical/type",
              dataType: "json", //返回数据形式为json
              headers: {
                Accept: "application/json; charset=utf-8",
                Authorization: layui.sessionData("userToken").key,
              },
              success: function (data) {
                $.each(data.data, function (index, item) {
                  $("#projectType").append(new Option(item.type, item.value));
                });
                form.render("select");
              },
              error: function (errorMsg) {
                alert("请求数据失败");
              },
            });
            form.on("select(projectType)", function (data) {
              if (data.value == 5) {
                $(".pipeline").css("display", "block");
                form.on("select(pipeline)", function (data) {
                  if (data.value == 1) {
                    $(".pipelineType").css("display", "block");
                  } else {
                    $(".pipelineType").css("display", "none");
                    pipelinesortSelect.setValue([]);
                  }
                });
              } else {
                $(".pipeline").css("display", "none");
                $("#pipeline").val("");
                $(".pipelineType").css("display", "none");
                pipelinesortSelect.setValue([]);
                form.render("select");
              }
            });
            $(".projectTypeClose").on("click", function () {
              $(".projectTypeSelect").hide();
            });
            //点击查询按钮，重载表格
            form.on("submit(LAY-user-back-search)", function (data) {
              var whereObj = {
                agenda: layui.sessionData("agenda").key || '0',
                projectName: $("#projectName").val(),
                selectType: layui.sessionData("status").key,
              };
              //执行重载
              table.reload("guardianshipProgram", { where: whereObj });
              table.reload("technicalReConsultation", { where: whereObj });
              table.reload("technicalReview", { where: whereObj });
              table.reload("protectionScheme", { where: whereObj });
              table.reload("combinedTransformation", { where: whereObj });
            });

            form.on("submit(LAY-user-back-clear)", function (data) {
              var whereObjC = {
                agenda: layui.sessionData("agenda").key || '0',
                projectName: "",
                selectType: layui.sessionData("status").key,
              };
              $(".technicalReviewHeader :input")
                .not(":button, :submit, :reset, :hidden")
                .val("")
                .removeAttr("checked")
                .removeAttr("selected");
              // form.val("layuiadmin-app-form-list");
              table.reload("guardianshipProgram", { where: whereObjC });
              table.reload("technicalReConsultation", { where: whereObjC });
              table.reload("technicalReview", { where: whereObjC });
              table.reload("protectionScheme", { where: whereObjC });
              table.reload("combinedTransformation", { where: whereObjC });
            });
            //  技术审查（征询）
            table.on("tool(technicalReConsultation)", function (obj) {
              var data = obj.data;
              var dataId = data.uuid;
              function dynamicConMenuFun(dataId) {
                $.ajax({
                  url: base_url + "/projects/dynamicCard/" + dataId,
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  async: true,
                  type: "get",
                  success: function (res) {
                    if (res.type == "success") {
                      var data = res.data;
                      var specialProtectionPlan = $(
                        '#LAY-system-side-menu dd[data-name="specialProtection"]',
                        parent.document
                      );
                      var outlineProject = $(
                        '#LAY-system-side-menu dd[data-name="guardianshipProgram"]',
                        parent.document
                      );
                      var techAuditOpinion = $(
                        '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                        parent.document
                      );
                      techAuditOpinion.show();
                      data.specialProtectionPlan == "0"
                        ? specialProtectionPlan.hide()
                        : specialProtectionPlan.show();
                      data.outlineProject == "0"
                        ? outlineProject.hide()
                        : outlineProject.show();
                    }
                  },
                });
              }
              layui.data("uuid", {
                key: "key",
                value: dataId,
              });
              layui.data("no", {
                key: "key",
                value: data.no,
              });
              layui.data("reviewType", {
                key: "key",
                value: 2,
              });
              layui.data("reviewSelectType", {
                key: "key",
                value: "2",
              });
              if (obj.event === "projectName") {
                dynamicConMenuFun(dataId);
                $(this).attr("lay-href", "./pages/projectOverview.html");
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              } else if (obj.event === "zxtechnicalReviewOpinions") {
                dynamicConMenuFun(dataId);
                layer.open({
                  type: 1,
                  skin: "demo-class",
                  area: ["600px", "300px"],
                  shadeClose: true,
                  content: $("#consultTechnicalReview").html(),
                  title: ["项目类型"],
                  btn: ["确定", "取消"],
                  success: function () {
                    form.render();
                  },
                  yes: function (index, layero) {
                    if ($("#typeA").val() == "") {
                      layer.msg(
                        "请选择项目类型",
                        { time: 600 },
                        function () {}
                      );
                    } else {
                      $(
                        '#LAY-system-side-menu li[data-name="technicalReview"]',
                        parent.document
                      ).addClass("layui-nav-itemed");
                      $(
                        '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                        parent.document
                      ).addClass("layui-nav-itemed");
                      $(
                        '#LAY-system-side-menu dd[data-name="opinionGeneration"]',
                        parent.document
                      ).addClass("layui-this");
                      layui.data("technicalType", {
                        key: "key",
                        value: 0,
                      });
                      var btn = layero.find(".layui-layer-btn");
                      btn.find(".layui-layer-btn0").attr({
                        "lay-href": "./pages/technicalReviewOpinions.html",
                      });
                      $("#projectTypeSelectForm")[0].reset(); //重置form
                      layer.closeAll();
                    }
                  },
                  cancel: function (index, layero) {
                    $("#projectTypeSelectForm")[0].reset();
                    layer.close(index);
                    return false;
                  },
                });
              } else if (obj.event === "zxtechnicalRequirement") {
                dynamicConMenuFun(dataId);
                $(this).attr(
                  "lay-href",
                  "./pages/technicalReviewOpinionss.html"
                );
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                $(
                  '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                // $(
                //   '#LAY-system-side-menu dd[data-name="opinionGeneration"]',
                //   parent.document
                // ).addClass("layui-this");
                // $(
                //   '#LAY-system-side-menu dd[data-name="specialProtection"]',
                //   parent.document
                // ).remove();
              } else if (obj.event === "zxdraftUpload") {
                dynamicConMenuFun(dataId);
                $(".fileUploadBtn").removeAttr("lay-href");
                $(".draftUpload").show();
                $(".additionInformation").hide();
                $(".projectTypeSelect").hide();
                $(".meetingBox").hide();
                $(".specialProtection").hide();
                $(".fileUploadBtn").on("click", function () {
                  if ($(".fileUploadDelete").html() == "") {
                    return layer.msg(
                      "请选择技审草稿",
                      { time: 500 },
                      function () {}
                    );
                    $(".fileUploadBtn").removeAttr("lay-href");
                  }
                });
                $("#draftUploadCancel").on("click", function () {
                  $(".draftUpload").hide();
                });
              } else if (obj.event === "zxadditionalInformation") {
                dynamicConMenuFun(dataId);
                $(".additionalInformationBtn").removeAttr("lay-href");
                $(".additionInformation").show();
                $(".projectTypeSelect").hide();
                $(".draftUpload").hide();
                $(".meetingBox").hide();
                $(".specialProtection").hide();
                $(".additionalInformationBtn").on("click", function () {
                  if ($(".additionInformationDelete").html() == "") {
                    return layer.msg(
                      "请选择要上传的补充资料",
                      { time: 500 },
                      function () {}
                    );
                    $(".additionalInformationBtn").removeAttr("lay-href");
                  }
                });
                $("#additionInformationCancel").on("click", function () {
                  additionInformationClear();
                });
              } else if (obj.event === "zxholdMeeting") {
                openMeetAddresSelect(data);
              }
            });
            function meetingForm() {
              if (infoData == true) {
                $.ajax({
                  type: "GET",
                  async: false, //异步执行
                  url: base_url + "/user/selectUsers",
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  success: function (data) {
                    infoData = false;
                    var externalUsersData = data.data.externalUsers;
                    externalUsersDataN = externalUsersData.map(
                      (item, index) => {
                        return {
                          name: item.username,
                          value: index,
                        };
                      }
                    );
                    participantsNSelect = xmSelect.render({
                      el: "#participantsN",
                      name: "pipelinesort",
                      filterable: true,
                      layVerify: "required",
                      layVerType: "msg",
                      theme: {
                        color: "#334d80",
                      },
                      language: "zn",
                      data: externalUsersDataN,
                    });
                    var innerUsersData = data.data.innerUsers;
                    innerUsersDataN = innerUsersData.map((item) => {
                      return {
                        name: item.username,
                        value: item.userNumber,
                      };
                    });
                    participantsWSelect = xmSelect.render({
                      el: "#participantsW",
                      name: "pipelinesort",
                      filterable: true,
                      layVerify: "required",
                      layVerType: "msg",
                      theme: {
                        color: "#334d80",
                      },
                      language: "zn",
                      data: innerUsersDataN,
                    });
                  },
                });
              }
            }
            function meetingBtn(type) {
              if (infoDataa == true) {
                externalUsersDataO = participantsNSelect
                  .getValue()
                  .map((item, index) => {
                    return {
                      userName: item.name,
                      userId: "",
                    };
                  });
                innerUsersDataO = participantsWSelect
                  .getValue()
                  .map((item, index) => {
                    return {
                      userName: item.name,
                      userId: item.value,
                    };
                  });
                let date = new Date(
                  $("#changeDate").val() + " " + $("#changeDateS").val()
                );
                let date2 = new Date(
                  $("#changeDate").val() + " " + $("#changeDateE").val()
                );
                let meetingStarttime = dateFormat("YYYY-mm-dd HH:MM", date);
                let meetingEndtime = dateFormat("YYYY-mm-dd HH:MM", date2);
                $.ajax({
                  type: "post",
                  async: true, //异步执行
                  url: base_url + "/meeting",
                  contentType: "application/json",
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  data: JSON.stringify({
                    meetingHeadline: $("#meetingHeadline").val(),
                    startTime: meetingStarttime,
                    endTime: meetingEndtime,
                    content: $("#meetingContent").val(),
                    orgUserNumber: $("#huiyi").val(),
                    projectId: layui.data("uuid").key,
                    site: $("#changeDateA").val(),
                    remarks: $("#meetingRemarks").val(),
                    participantList: externalUsersDataO.concat(innerUsersDataO),
                    type: type,
                    status: 1,
                  }),
                  success: function (data) {
                    if (data.type == "success") {
                      infoDataa = false;
                      // console.log(layui.sessionData("noticeMeetingLength").key);

                      $(".noticeMeeting").html(
                        layui.sessionData("noticeMeetingLength").key
                      );
                      layer.msg(data.message, { icon: 6 });
                      $(".noticeMeetingBtn")
                        .removeClass("layui-btn-disabled")
                        .attr("disabled", false);
                      $(".noticeMeetingBtn").on("click", function () {
                        // downloadFileByForm()
                        // function downloadFileByForm() {
                        //   var url = base_url +"/meeting/download";
                        //   var fileName = "testAjaxDownload.txt";
                        //   var form = $("<form></form>").attr("action", url).attr("method", "post");
                        //   form.append($("<input></input>").attr("type", "hidden").attr("name", "meetingId").attr("value", data.data));
                        //   form.appendTo('body').submit().remove();
                        // }
                        window.location.href =
                          base_url + "/meeting/download/2/" + data.data;
                        // window.location.href = base_url+'/meeting/download/'+data.data;
                      });
                    } else {
                      layer.msg(data.message, { icon: 5 });
                    }
                  },
                });
              }
            }
            //技术审查（许可）
            table.on("tool(technicalReview)", function (obj) {
              var data = obj.data;
              var dataId = data.uuid;
              function dynamicConMenuFun(dataId) {
                $.ajax({
                  url: base_url + "/projects/dynamicCard/" + dataId,
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  async: true,
                  type: "get",
                  success: function (res) {
                    if (res.type == "success") {
                      var data = res.data;
                      var specialProtectionPlan = $(
                        '#LAY-system-side-menu dd[data-name="specialProtection"]',
                        parent.document
                      );
                      var outlineProject = $(
                        '#LAY-system-side-menu dd[data-name="guardianshipProgram"]',
                        parent.document
                      );
                      var techAuditOpinion = $(
                        '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                        parent.document
                      );
                      techAuditOpinion.show();
                      data.specialProtectionPlan == "0"
                        ? specialProtectionPlan.hide()
                        : specialProtectionPlan.show();
                      data.outlineProject == "0"
                        ? outlineProject.hide()
                        : outlineProject.show();
                    }
                  },
                });
              }
              var type = "";
              layui.data("uuid", {
                key: "key",
                value: dataId,
              });
              layui.data("no", {
                key: "key",
                value: data.no,
              });
              layui.data("reviewType", {
                key: "key",
                value: 1,
              });
              layui.data("technicalType", {
                key: "key",
                value: 0,
              });
              layui.data("reviewSelectType", {
                key: "key",
                value: "3",
              });
              if (obj.event === "projectName") {
                dynamicConMenuFun(dataId);
                $(this).attr("lay-href", "./pages/projectOverview.html");
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              } else if (obj.event === "technicalRequirement") {
                dynamicConMenuFun(dataId);
                $(".projectTypeSelect").hide();
                $(".meetingBox").hide();
                $(".draftUpload").hide();
                $(".additionInformation").hide();
                $(".specialProtection").hide();
                $(this).attr(
                  "lay-href",
                  "./pages/technicalReviewOpinionss.html"
                );
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                $(
                  '#LAY-system-side-menu dd[data-name="specialProtection"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                $(
                  '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              } else if (obj.event === "technicalReviewOpinions") {
                dynamicConMenuFun(dataId);
                $(".projectTypeSelect").show();
                $(".meetingBox").hide();
                $(".draftUpload").hide();
                $(".additionInformation").hide();
                $(".specialProtection").hide();
                $.ajax({
                  type: "post",
                  async: false, //异步执行
                  url: base_url + "/Technical/serverQueryLine",
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  contentType: "application/json",
                  dataType: "json",
                  data: JSON.stringify({ uuid: layui.data("uuid").key }),
                  success: function (data) {
                    if (data.code == 200) {
                      $("#projectType").val(data.data.type);
                      var pipelinesort = data.data.pipelinesort;

                      if (data.data.type == 5) {
                        $(".pipeline").css("display", "block");
                        $("#pipeline").val(data.data.pipeline);
                        if (data.data.pipeline == 1) {
                          $(".pipelineType").css("display", "block");
                          pipelinesortSelect.setValue(pipelinesort.split(","));
                        }
                      }
                      form.on("select(pipeline)", function (data) {
                        if (data.value == 1) {
                          $(".pipelineType").css("display", "block");
                          pipelinesortSelect.setValue(
                            pipelinesort.split(",").map(Number)
                          );
                        } else {
                          $(".pipelineType").css("display", "none");
                          pipelinesortSelect.setValue([]);
                        }
                      });
                      var lineType = [];
                      lineType = data.data.line_type.split(",");
                      var lineTypeCheckbox = $("input[name='lineType']");
                      checkBoxFun(lineTypeCheckbox, lineType);

                      var stationFlag = [];
                      stationFlag = data.data.station_flag.split(",");
                      var stationFlagCheckbox = $("input[name='stationFlag']");
                      checkBoxFun(stationFlagCheckbox, stationFlag);

                      var stationArea = [];
                      stationArea = data.data.station_area.split(",");
                      var stationAreaCheckbox = $("input[name='stationArea']");
                      checkBoxFun(stationAreaCheckbox, stationArea);

                      function checkBoxFun(name, data) {
                        for (var j = 0; j < data.length; j++) {
                          for (var i = 0; i < name.length; i++) {
                            if (name[i].value === data[j]) {
                              console.log(name[i].checked);
                              name[i].checked = true;
                            }
                          }
                        }
                      }
                      form.render();
                    }
                  },
                });

                // $("#projectTypeForm")[0].reset();
                $("#pipelineForm").on("click", function () {
                  var type = $("#projectType").val();
                  var pipeline = $("#pipeline").val();
                  var pipelinesort = pipelinesortSelect.getValue("valueStr");
                  var groupCheckbox = $("input[name='lineType']");
                  var lineType = "";
                  for (i = 0; i < groupCheckbox.length; i++) {
                    if (groupCheckbox[i].checked) {
                      var val = groupCheckbox[i].value;
                      if (lineType.length > 0) {
                        lineType += "," + val;
                        console.log(data);
                      } else {
                        lineType += val;
                      }
                    }
                  }
                  var stationFlagCheckbox = $("input[name='stationFlag']");
                  var stationFlag = "";
                  for (i = 0; i < stationFlagCheckbox.length; i++) {
                    if (stationFlagCheckbox[i].checked) {
                      var val = stationFlagCheckbox[i].value;
                      if (stationFlag.length > 0) {
                        stationFlag += "," + val;
                      } else {
                        stationFlag += val;
                      }
                    }
                  }
                  var stationAreaCheckbox = $("input[name='stationArea']");
                  var stationArea = "";
                  for (i = 0; i < stationAreaCheckbox.length; i++) {
                    if (stationAreaCheckbox[i].checked) {
                      var val = stationAreaCheckbox[i].value;
                      if (stationArea.length > 0) {
                        stationArea += "," + val;
                      } else {
                        stationArea += val;
                      }
                    }
                  }
                  $.ajax({
                    type: "post",
                    async: true, //异步执行
                    url: base_url + "/Technical/updateQueryLine",
                    headers: {
                      Accept: "application/json; charset=utf-8",
                      Authorization: layui.sessionData("userToken").key,
                    },
                    contentType: "application/json; charset=UTF-8",
                    WdataType: "json",
                    data: JSON.stringify({
                      lineType: lineType,
                      stationFlag: stationFlag,
                      stationArea: stationArea,
                      uuid: layui.data("uuid").key,
                    }),
                    success: function (data) {
                      if (data.code == 200) {
                        layer.msg(data.message, { icon: 6 });
                      } else {
                        layer.msg(data.message, { icon: 5 });
                      }
                    },
                  });
                  if (type == "") {
                    return layer.msg(
                      "请选择项目类型",
                      { time: 500 },
                      function () {}
                    );
                  } else {
                    layui.data("technicalType", {
                      key: "key",
                      value: type,
                    });
                    layui.data("pipeline", {
                      key: "key",
                      value: pipeline,
                    });
                    layui.data("pipelinesort", {
                      key: "key",
                      value: pipelinesort,
                    });
                    layui.data("stationFlag", {
                      key: "key",
                      value: stationFlag,
                    });
                    layui.data("stationArea", {
                      key: "key",
                      value: stationArea,
                    });
                    if (type == 5) {
                      layui.data("technicalType", {
                        key: "key",
                        value: 5,
                      });
                      $(this).attr(
                        "lay-href",
                        "./pages/technicalReviewOpinions.html"
                      );
                    } else {
                      $(this).attr(
                        "lay-href",
                        "./pages/technicalReviewOpinions.html"
                      );
                    }
                    $(
                      '#LAY-system-side-menu li[data-name="technicalReview"]',
                      parent.document
                    )
                      .addClass("layui-nav-itemed")
                      .removeClass("layui-this");
                    $(
                      '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                      parent.document
                    ).addClass("layui-nav-itemed");
                    $(
                      '#LAY-system-side-menu dd[data-name="opinionGeneration"]',
                      parent.document
                    ).addClass("layui-this");
                    technicalReviewOpinionsClear();
                  }
                });
                form.on("submit(cancelBtn)", function (dataa) {
                  technicalReviewOpinionsClear();
                });
              } else if (obj.event === "holdMeeting") {
                openMeetAddresSelect(data);
              } else if (obj.event === "draftUpload") {
                $(".fileUploadBtn").removeAttr("lay-href");
                $(".draftUpload").show();
                $(".additionInformation").hide();
                $(".projectTypeSelect").hide();
                $(".meetingBox").hide();
                $(".specialProtection").hide();
                $(".fileUploadBtn").on("click", function () {
                  if ($(".fileUploadDelete").html() == "") {
                    return layer.msg(
                      "请选择技审草稿",
                      { time: 500 },
                      function () {}
                    );
                    $(".fileUploadBtn").removeAttr("lay-href");
                  }
                });
                // $("#draftUploadCancel").on("click", function () {
                //   fileUploadClear();
                // });

                var loadIndex = "";
                var fileUploadUploadRender = "";
                fileUploadUploadRender = upload.render({
                  elem: "#fileUpload",
                  elemList: $(".fileUploadDelete"), //列表元素对象
                  accept: "file",
                  auto: false,
                  url: base_url + "/Technical/technicalfile",
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  bindAction: ".fileUploadButton",
                  before: function (obj) {
                    this.data = {
                      uuid: layui.data("uuid").key,
                      reviewType: layui.data("reviewType").key,
                    };
                    if ($(".fileUploadDelete").html() == "") {
                      return layer.msg(
                        "请先选择文件",
                        { time: 500 },
                        function () {}
                      );
                    }
                    loadIndex = layer.load(2);
                  },
                  choose: function (obj) {
                    var that = this;
                    var files = (this.files = obj.pushFile()); //将每次选择的文件追加到文件队列 //读取本地文件
                    obj.preview(function (index, file, result) {
                      let html = "";
                      html = $(
                        [
                          '<div id="upload-' +
                            index +
                            '" style="margin:5px 0">',
                          "<span>" + file.name + "</span>",
                          '<span style="margin-left:10px">',
                          '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>',
                          // ,'<button class="layui-btn layui-btn-xs layui-btn-danger fileUploadButton">上传</button>'
                          "</span>",
                          "</div>",
                        ].join("")
                      );
                      //删除
                      html.find(".demo-delete").on("click", function () {
                        delete files[index]; //删除对应的文件
                        html.remove();
                        fileUploadUploadRender.config.elem.next()[0].value = "";
                      });
                      that.elemList.append(html);
                    });
                  },
                  done: function (res, index, upload) {
                    var that = this;
                    if (res.code == 200) {
                      $(".fileUploadBtn").on("click", function () {
                        dynamicConMenuFun(dataId);
                        $(this).attr(
                          "lay-href",
                          "./pages/technicalReviewDraft.html"
                        );
                        $(
                          '#LAY-system-side-menu li[data-name="technicalReview"]',
                          parent.document
                        ).addClass("layui-nav-itemed");
                        $(
                          '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                          parent.document
                        ).addClass("layui-nav-itemed");

                        // fileUploadClear();
                      });
                      var html = that.elemList.find("div#upload-" + index);
                      html.parent().children().html(""); //清空操作
                      delete this.files[index]; //删除文件队列已经上传成功的文件
                    }
                    layer.msg(res.message, { time: 10000 }, function () {});
                    layer.close(loadIndex);
                  },
                  error: function () {
                    layer.close(loadIndex);
                  },
                });
              } else if (obj.event === "additionalInformation") {
                $(".additionalInformationBtn").removeAttr("lay-href");
                $(".additionInformation").show();
                $(".projectTypeSelect").hide();
                $(".draftUpload").hide();
                $(".meetingBox").hide();
                $(".specialProtection").hide();
                $(".additionalInformationBtn").on("click", function () {
                  if ($(".additionInformationDelete").html() == "") {
                    return layer.msg(
                      "请选择要上传的补充资料",
                      { time: 500 },
                      function () {}
                    );
                    $(".additionalInformationBtn").removeAttr("lay-href");
                  }
                });
                $("#additionInformationCancel").on("click", function () {
                  additionInformationClear();
                });
                // form.on('submit(additionInformationCancel)', function(dataa){
                //   additionInformationClear();
                // })
              } else if (obj.event === "specialProtectionPlan") {
                $(".projectTypeSelect").hide();
                $(".draftUpload").hide();
                $(".additionInformation").hide();
                $(".meetingBox").hide();
                $("#technicalReviewDraft").empty();
                $("#specialProtectionScheme").empty();
                form.render("select");
                $(".specialProtectionConSure").on("click", function () {
                  dynamicConMenuFun(dataId);
                  layer.msg("专项保护方案发送成功", { icon: 6 });
                  $(".specialProtection").hide();
                });
                $.ajax({
                  type: "post",
                  async: true, //异步执行
                  url: base_url + "/Technical/jslist",
                  contentType: "application/json",
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  data: JSON.stringify({ fileUuid: data.uuid }),
                  success: function (data) {
                    if (data.code == 200) {
                      var arr = data.data;
                      $("#technicalReviewDraft").empty();
                      $("#technicalReviewDraft").attr("data-key", "");
                      if (arr.length > 0) {
                        $.each(arr, function (index, item) {
                          if (index == 0) {
                            $("#technicalReviewDraft").attr(
                              "data-key",
                              item.fileId
                            );
                            specialProtectionScheme(1);
                          }
                          $("#technicalReviewDraft").append(
                            new Option(item.fileName, item.fileId)
                          );
                        });
                        form.render("select");
                      } else {
                        specialProtectionScheme(2);
                      }
                    }
                  },
                });
                form.on("select(technicalReviewDraft)", function (data) {
                  $("#technicalReviewDraft").attr("data-key", data.value);
                  specialProtectionScheme();
                });
                function specialProtectionScheme(arrData) {
                  var dataKey = $("#technicalReviewDraft").attr("data-key");
                  if (dataKey == "") {
                    $("#technicalReviewDraft").empty();
                    $("#specialProtectionScheme").empty();
                  } else {
                    $.ajax({
                      type: "post",
                      async: true, //异步执行
                      url: base_url + "/Technical/zxlist",
                      contentType: "application/json",
                      headers: {
                        Accept: "application/json; charset=utf-8",
                        Authorization: layui.sessionData("userToken").key,
                      },
                      data: JSON.stringify({ no: dataKey }),
                      success: function (data) {
                        $("#specialProtectionScheme").empty();
                        if (data.data != "") {
                          $.each(data.data, function (index, item) {
                            if (index == 0) {
                              $("#specialProtectionScheme").attr(
                                "data-key",
                                item.no
                              );
                            }
                            $("#specialProtectionScheme").append(
                              new Option(item.pdfName, item.no)
                            );
                          });
                        } else {
                          $("#specialProtectionScheme").append(
                            new Option("没有选项", "")
                          );
                        }
                        form.render("select");
                      },
                    });
                  }
                }
                $(".specialProtection").show();
                $(".specialProtectionSchemeSee").on("click", function () {
                  var no = $(this)
                    .parent()
                    .parent()
                    .find("#specialProtectionScheme")
                    .val();
                  $(this).attr("lay-href", "./pages/specialProtectionEnd.html");
                  $(
                    '#LAY-system-side-menu li[data-name="technicalReview"]',
                    parent.document
                  ).addClass("layui-nav-itemed");
                  $(
                    '#LAY-system-side-menu dd[data-name="specialProtection"]',
                    parent.document
                  ).addClass("layui-nav-itemed");
                  $(".specialProtection").hide();
                });
                form.on("submit(specialProtectionCance)", function (dataa) {
                  specialProtectionPlanClear();
                });
              }
            });
            table.on("tool(protectionScheme)", function (obj) {
              var data = obj.data;
              var dataId = data.uuid;
              function dynamicConMenuFun(dataId) {
                $.ajax({
                  url: base_url + "/projects/dynamicCard/" + dataId,
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  async: true,
                  // dataType: "json",
                  type: "get",
                  success: function (res) {
                    if (res.type == "success") {
                      var data = res.data;

                      var specialProtectionPlan = $(
                        '#LAY-system-side-menu dd[data-name="specialProtection"]',
                        parent.document
                      );
                      var techAuditOpinion = $(
                        '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                        parent.document
                      );
                      var outlineProject = $(
                        '#LAY-system-side-menu dd[data-name="guardianshipProgram"]',
                        parent.document
                      );
                      outlineProject.show();
                      data.specialProtectionPlan == "0"
                        ? specialProtectionPlan.hide()
                        : specialProtectionPlan.show();
                      data.techAuditOpinion == "0"
                        ? techAuditOpinion.hide()
                        : techAuditOpinion.show();
                    }
                  },
                });
              }
              layui.data("uuid", {
                key: "key",
                value: data.uuid,
              });
              layui.data("no", {
                key: "key",
                value: data.no,
              });
              layui.data("reviewType", {
                key: "key",
                value: 1,
              });
              layui.data("reviewSelectType", {
                key: "key",
                value: "4",
              });
              var uuid = layui.data("uuid").key,
                no = layui.data("no").key,
                reviewType = layui.data("reviewType").key;
              if (obj.event === "projectName") {
                dynamicConMenuFun(dataId);
                $(this).attr("lay-href", "./pages/projectOverview.html");
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              } else if (obj.event === "specialProSchemeView") {
                dynamicConMenuFun(dataId);
                $(this).attr("lay-href", "./pages/specialProtectionStart.html");
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                $(
                  '#LAY-system-side-menu dd[data-name="specialProtection"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              } else if (obj.event === "planPassed") {
                //专项保护方案通过情况
                $.ajax({
                  type: "post",
                  async: true, //异步执行
                  url: base_url + "/SpecialProtection/SpecialProtectionPass",
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  contentType: "application/json; charset=UTF-8",
                  WdataType: "json",
                  data: JSON.stringify({
                    uuid: layui.data("uuid").key,
                    flow_status: "9",
                  }),
                  success: function (data) {
                    if (data.code == 200) {
                      layer.msg(data.message, {
                        time: 500,
                        icon: 6,
                        end: function () {
                          window.location.reload();
                        },
                      });
                    } else {
                      layer.msg(data.message, { icon: 2 });
                    }
                  },
                });
              } else if (obj.event === "planReturn") {
                // 专项保护方案-退回意见
                layer.open({
                  type: 1,
                  skin: "demo-class",
                  area: ["50%", "40%"],
                  shadeClose: true,
                  content: $("#returnCommentsxxx"),
                  title: ["退回意见"],
                  btn: ["确定", "取消"],
                  btnAlign: "c",
                  success: function (layero, index) {
                    $("#specialAuditor").val(layui.sessionData("userName").key);
                  },
                  yes: function (index, layero) {
                    // 1、先获取专项保护方案在档案系统的编号
                    $.ajax({
                      type: "post",
                      async: true, //异步执行
                      url:
                        base_url + "/SpecialProtection/specialProtectionPlanId",
                      headers: {
                        Accept: "application/json; charset=utf-8",
                        Authorization: layui.sessionData("userToken").key,
                      },
                      contentType: "application/json; charset=UTF-8",
                      WdataType: "json",
                      data: JSON.stringify({
                        uuid: layui.data("uuid").key,
                      }),
                      success: function (data) {
                        if (data.code == 200) {
                          // 2、根据获取的档案系统文件ID调用报审的专项保护方案退回接口

                          // 档案系统编号
                          var fileSystemFile = data.data.fileSystemFile;
                          // 档案系统word文件名
                          var wordname = data.data.wordname;
                          // 申报类型
                          var type = data.data.type;
                          // 退回意见
                          var commentsTxt = $("#commentsTxt").val();
                          // 审批人
                          var auditor = $("#specialAuditor").val();
                          // 联系方式
                          var contact = $("#contact").val();

                          $.ajax({
                            type: "post",
                            async: true, //异步执行
                            url: "http://10.1.14.200/MMS/api/plotting/checkProjectFile",
                            headers: {
                              Accept: "application/json; charset=utf-8",
                            },
                            contentType: "application/json; charset=UTF-8",
                            WdataType: "json",
                            data: JSON.stringify({
                              no: layui.data("no").key,
                              fileId: fileSystemFile,
                              fileName: wordname,
                              fileType: "word",
                              opinion: commentsTxt,
                              personNumber: auditor,
                              contact: contact,
                              type: type,
                              uuid: layui.data("uuid").key,
                            }),
                            success: function (data) {
                              if (data.code == 200) {
                                // 3、报审数据传入成功，调用技审流程变更状态接口变更流程状态
                                $.ajax({
                                  type: "post",
                                  async: true, //异步执行
                                  url:
                                    base_url +
                                    "/SpecialProtection/SpecialProtectionPass",
                                  headers: {
                                    Accept: "application/json; charset=utf-8",
                                    Authorization:
                                      layui.sessionData("userToken").key,
                                  },
                                  contentType:
                                    "application/json; charset=UTF-8",
                                  WdataType: "json",
                                  data: JSON.stringify({
                                    uuid: layui.data("uuid").key,
                                    flow_status: "8",
                                  }),
                                  success: function (data) {
                                    if (data.code == 200) {
                                      layer.msg(data.message, {
                                        time: 1000,
                                        icon: 6,
                                        end: function () {
                                          window.location.reload();
                                        },
                                      });
                                    } else {
                                      layer.msg(data.message, { icon: 2 });
                                    }
                                  },
                                });
                              } else {
                                layer.msg(data.message, { icon: 2 });
                              }
                            },
                          });
                        } else {
                          layer.msg(data.message, { icon: 2 });
                        }
                      },
                    });
                  },
                });
              }
            });
            // 监护大纲
            table.on("tool(guardianshipProgram)", function (obj) {
              var dataId = obj.data.uuid;
              // tab切换时根据值控制左侧菜单的显示与隐藏
              function dynamicConMenuFun(dataId) {
                $.ajax({
                  url: base_url + "/projects/dynamicCard/" + dataId,
                  headers: {
                    Accept: "application/json; charset=utf-8",
                    Authorization: layui.sessionData("userToken").key,
                  },
                  async: true,
                  // dataType: "json",
                  type: "get",
                  success: function (res) {
                    if (res.type == "success") {
                      var data = res.data;
                      var specialProtectionPlan = $(
                        '#LAY-system-side-menu dd[data-name="specialProtection"]',
                        parent.document
                      );
                      var outlineProject = $(
                        '#LAY-system-side-menu dd[data-name="guardianshipProgram"]',
                        parent.document
                      );
                      var techAuditOpinion = $(
                        '#LAY-system-side-menu dd[data-name="technicalReviewOpinions"]',
                        parent.document
                      );
                      outlineProject.show();
                      data.specialProtectionPlan == "0"
                        ? specialProtectionPlan.hide()
                        : specialProtectionPlan.show();
                      // data.outlineProject == "0"
                      //   ? outlineProject.hide()
                      //   : outlineProject.show();
                      data.techAuditOpinion == "0"
                        ? techAuditOpinion.hide()
                        : techAuditOpinion.show();
                    }
                  },
                });
              }

              layui.data("uuid", {
                key: "key",
                value: dataId,
              });
              layui.data("no", {
                key: "key",
                value: obj.data.no,
              });
              layui.data("reviewSelectType", {
                key: "key",
                value: "1",
              });
              if (obj.event === "projectName") {
                dynamicConMenuFun(dataId);
                $(this).attr("lay-href", "./pages/projectOverview.html");
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                // $(
                //   '#LAY-system-side-menu dd[data-name="projectOverview"]',
                //   parent.document
                // ).removeClass("layui-this");
              } else if (obj.event === "guardianTechnicalRequirement") {
                dynamicConMenuFun(dataId);
                $(this).attr("lay-href", "./pages/gradeDetermination.html");
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                $(
                  '#LAY-system-side-menu dd[data-name="guardianshipProgram"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              } else if (obj.event === "technicalRequirement") {
                dynamicConMenuFun(dataId);
                layui.data("reviewType", {
                  key: "key",
                  value: 1,
                });
                $(this).attr(
                  "lay-href",
                  "./pages/technicalReviewOpinionss.html"
                );
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                $(
                  '#LAY-system-side-menu dd[data-name="guardianshipProgram"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              } else if (obj.event === "guardianshipAuditView") {
                dynamicConMenuFun(dataId);
                // 监护大纲审核查看
                $(this).attr("lay-href", "./pages/guardianshipProgram.html");
                $(
                  '#LAY-system-side-menu li[data-name="technicalReview"]',
                  parent.document
                ).addClass("layui-nav-itemed");
                $(
                  '#LAY-system-side-menu dd[data-name="guardianshipProgram"]',
                  parent.document
                ).addClass("layui-nav-itemed");
              }
            });
            $(".projectTypeSelect .closeBtn").on("click", function () {
              technicalReviewOpinionsClear();
            });
            $(".draftUpload .closeBtn").on("click", function () {
              $(".draftUpload").hide();
            });
            $("#draftUploadCancel").on("click", function () {
              $(".draftUpload").hide();
            });
            $(".meetingBox .closeBtn").on("click", function () {
              $(".meetingBox").hide();
              infoData = true;
              infoDataa = true;
              meetingInformationClear();
              return false;
            });
            $(".returnComments .closeBtn").on("click", function () {
              $("#returnComments")[0].reset();
              $(".returnComments").hide();
            });
            $(".specialProtection .closeBtn").on("click", function () {
              specialProtectionPlanClear();
            });
            $(".meetingInformationBox .closeBtn").on("click", function () {
              meetingInformationClear();
            });
            $(".closeBtn").on("click", function () {
              additionInformationClear();
            });
            $(".fileUploadButton").on("click", function () {
              if ($(".fileUploadDelete").html() == "") {
                return layer.msg("请先选择文件", { time: 500 }, function () {});
              }
            });
            $(".addfileUploadButton").on("click", function () {
              if ($(".additionInformationDelete").html() == "") {
                return layer.msg("请先选择文件", { time: 500 }, function () {});
              }
            });

            var additionFileUploadRender = upload.render({
              elem: "#additionFileUpload",
              elemList: $(".additionInformationDelete"), //列表元素对象
              accept: "file",
              multiple: true,
              auto: false,
              url: base_url + "/Technical/accessoryfile", //改成您自己的上传接口
              bindAction: ".addfileUploadButton",
              headers: {
                Accept: "application/json; charset=utf-8",
                Authorization: layui.sessionData("userToken").key,
              },
              before: function (obj) {
                this.data = {
                  uuid: layui.data("uuid").key,
                  reviewType: layui.data("reviewType").key,
                };
                if ($(".additionInformationDelete").html() == "") {
                  return layer.msg(
                    "请先选择文件",
                    { time: 500 },
                    function () {}
                  );
                }
                loadIndex = layer.load(2);
              },
              choose: function (obj) {
                var that = this;
                var files = (this.files = obj.pushFile()); //将每次选择的文件追加到文件队列 //读取本地文件
                obj.preview(function (index, file, result) {
                  let html = "";
                  html = $(
                    [
                      '<div id="upload-' + index + '" style="margin:5px 0">',
                      "<span>" + file.name + "</span>",
                      '<span style="margin-left:10px">',
                      '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>',
                      "</span>",
                      "</div>",
                    ].join("")
                  );
                  //删除
                  html.find(".demo-delete").on("click", function () {
                    delete files[index]; //删除对应的文件
                    html.remove();
                    additionFileUploadRender.config.elem.next()[0].value = "";
                  });
                  that.elemList.append(html);
                });
              },
              done: function (res, index, upload) {
                var that = this;
                if (res.code == 200) {
                  $(".additionalInformationBtn").on("click", function () {
                    $(this).attr("lay-href", "./pages/projectOverview.html");
                    $(
                      '#LAY-system-side-menu li[data-name="technicalReview"]',
                      parent.document
                    ).addClass("layui-nav-itemed");
                    // $(
                    //   '#LAY-system-side-menu dd[data-name="specialProtection"]',
                    //   parent.document
                    // ).remove();
                    additionInformationClear();
                  });
                  var html = that.elemList.find("div#upload-" + index);
                  html.parent().children().html(""); //清空操作
                  delete this.files[index]; //删除文件队列已经上传成功的文件
                }
                layer.msg(res.message, { time: 10000 }, function () {});
                layer.close(loadIndex);
              },
              error: function () {
                layer.close(loadIndex);
              },
            });

            //执行实例
            var uploadInst = upload.render({
              elem: "#test10", //绑定元素
              auto: false,
              accept: "file",
              bindAction: "#upload",
              url: base_url + "/Technical/technicalfile",
              before: function (obj) {
                this.data = {
                  uuid: layui.data("uuid").key,
                  reviewType: layui.data("reviewType").key,
                };
                if ($(".fileUploadDelete").html() == "") {
                  return layer.msg(
                    "请先选择文件",
                    { time: 500 },
                    function () {}
                  );
                }
                layer.load(2);
              },
              choose: function (obj) {
                obj.preview(function (index, file, result) {
                  document.getElementById("file_name").innerHTML = file.name;
                });
              },
              done: function (res) {
                document.getElementsByClassName("layui-layer-close")[0].click();
                layer.msg("上传成功");
              },
              error: function () {
                layer.msg("上传失败，请重新上传");
              },
            });
            function meetingInformationClear() {
              $(".meetingInformationBox").hide();
              $("#meetingInformationForm")[0].reset();
              $(".noticeMeetingBtn")
                .addClass("layui-btn-disabled")
                .attr("disabled", true);
              // var participantsNSelect = '';
              // var participantsWSelect = '';
              infoData = true;
              infoDataa = true;
              return false;
            }
            function specialProtectionPlanClear() {
              $("#specialProtection")[0].reset();
              layui.form.render();
              $(".specialProtection").hide();
            }
            // function fileUploadClear() {
            //   $(".fileUploadDelete").html("");
            //   fileUploadUploadRender.config.elem.next()[0].value = ""; //清空 input file 值，以免删除后出现同名文件不可选
            //   $(".draftUpload").hide();
            // }
            function additionInformationClear() {
              $(".additionInformationDelete").html("");
              additionFileUploadRender.config.elem.next()[0].value = "";
              $(".additionInformation").hide();
            }
            function technicalReviewOpinionsClear() {
              $("#projectTypeForm")[0].reset();
              pipelinesortSelect.setValue([]);
              $(".projectTypeSelect").hide();
              $(".pipeline").hide();
              $(".pipelineType").hide();
            }
            function openMeetAddresSelect(data) {
              meetAddresSelect = layer.open({
                title: '<i class="fa fa-plus"></i>&nbsp;会议选择',
                type: 1,
                fix: false,
                skin: "layui-layer-rim",
                area: ["40%", "45%"],
                content: $("#meetAddressSelect").html(),
                success: function (layero, index) {
                  $(".onlineMeeting").on("click", function () {
                    flagg = 1;
                    type = 1;
                    openLayer(flagg, data);
                    layer.close(index); //如果设定了yes回调，需进行手工关闭
                  });
                  $(".offlineMeeting").on("click", function () {
                    flagg = 2;
                    openLayer(flagg, data);
                  });
                },
              });
            }
            function openLayer(flagg, data) {
              addIndex = layer.open({
                title: '<i class="fa fa-plus"></i>&nbsp;新增会议',
                skin: "meetingNotice",
                type: 1,
                fix: false,
                skin: "layui-layer-rim",
                // 加上边框
                area: ["45%", "70%"],
                // 宽高
                content: $("#addMeetingForm").html(),
                success: function (layero, index) {
                  let str = data.projectName ? data.projectName : "";
                  str = str.length > 11 ? str.slice(0, 11) : str;
                  $("#meetingHeadline").val(str);
                  // $("#meetingHeadline").val(str).css('disabled',true)
                  initDateCtrl(flagg);
                  var innerUsersDataNv = [];
                  $.ajax({
                    type: "GET",
                    async: false, //异步执行
                    url: base_url + "/user/selectUsers",
                    headers: {
                      Accept: "application/json; charset=utf-8",
                      Authorization: layui.sessionData("userToken").key,
                    },
                    success: function (data) {
                      var externalUsersData = data.data.externalUsers;
                      externalUsersDataN = externalUsersData.map(
                        (item, index) => {
                          return {
                            name: item.username,
                            value: index,
                          };
                        }
                      );
                      participantsNSelect = xmSelect.render({
                        el: "#participantsN",
                        name: "pipelinesort",
                        filterable: true,
                        theme: {
                          color: "#334d80",
                        },
                        language: "zn",
                        data: externalUsersDataN,
                      });
                      var innerUsersData = data.data.innerUsers;
                      innerUsersDataN = innerUsersData.map((item) => {
                        return {
                          name: item.username,
                          value: item.userNumber,
                        };
                      });
                      participantsWSelect = xmSelect.render({
                        el: "#participantsW",
                        name: "pipelinesort",
                        filterable: true,
                        theme: {
                          color: "#334d80",
                        },
                        language: "zn",
                        data: innerUsersDataN,
                      });
                    },
                  });
                  $("#orgUserNumber").val(layui.sessionData("userName").key);
                  // 表单提交事件
                  form.on("submit(formSubmit)", function (d) {
                    externalUsersDataO = participantsNSelect
                      .getValue()
                      .map((item, index) => {
                        return {
                          userName: item.name,
                          userId: "",
                        };
                      });
                    innerUsersDataO = participantsWSelect
                      .getValue()
                      .map((item, index) => {
                        return {
                          userName: item.name,
                          userId: item.value,
                        };
                      });
                    d.field.participantList =
                      externalUsersDataO.concat(innerUsersDataO);

                    d.field.startTime =
                      $("#meetingDate").val() +
                      " " +
                      $("#meetingTime").html().split("-")[0] +
                      ":" +
                      "00";

                    d.field.endTime =
                      $("#meetingDate").val() +
                      " " +
                      $("#meetingTime").html().split("-")[1].split(" ")[0] +
                      ":" +
                      "00";
                    delete d.field.meetingDate;
                    delete d.field.meetingTime;
                    delete d.field.pipelinesort;
                    d.field.projectId = data.uuid;
                    d.field.site = $("#meetingTime")
                      .html()
                      .split("-")[1]
                      .split(" ")[1];

                    $.ajax({
                      type: "POST",
                      url: base_url + "/meeting",
                      contentType: "application/json; charset=utf-8",
                      async: true,
                      data: JSON.stringify(d.field),
                      headers: {
                        Accept: "application/json; charset=utf-8",
                        Authorization: layui.sessionData("userToken").key,
                      },
                      success: function (res) {
                        layer.closeAll("loading");
                        if (res.code == 200) {
                          layer.msg(res.message, { icon: 1 });
                          // $(".noticeMeetingTotal").text(
                          //   layui.sessionData("noticeMeetingLength").key + 1
                          // );
                          $(".meetingNotice")
                            .removeClass("layui-btn-disabled")
                            .attr("disabled", false);
                          $(".enterMeeting")
                            .addClass("layui-btn-disabled")
                            .attr("disabled", true);
                          $(".meetingNotice").on("click", function () {
                            window.location.href =
                              base_url + "/meeting/download/2/" + res.data;
                            layer.closeAll();
                          });
                          // layer.closeAll();
                          return false;
                        } else {
                          layer.msg(res.message, { icon: 2 });
                        }
                      },
                    });
                    return false;
                  });
                },
              });
            }
            function initDateCtrl() {
              //日期时间选择器
              laydate.render({
                elem: "#meetingDate", //指定元素
                min: 0,
                ready: function (value) {
                  disabled_date(value, $("#appointmentDate").val());
                },
                change: function (value, date) {
                  disabled_date(date, $("#appointmentDate").val());
                },
                done: function (value, date) {
                  if (flagg == 1) {
                    changeTimeForm = layer.open({
                      title: "",
                      type: 1,
                      fix: false,
                      skin: "layui-layer-rim",
                      // 加上边框
                      area: ["43%", "37%"],
                      // 宽高
                      content: $("#changeTimeForm").html(),
                      success: function (layero, index) {
                        renderData();
                      },
                      cancel: function (index, layero) {
                        var chooseAfterValueNew = indexItemm.sort((a, b) => {
                          return a > b ? 1 : -1;
                        });
                        if (chooseAfterValueNew.length == 0) {
                          $("#meetingTime").html("");
                        } else {
                          $("#meetingTime").html(
                            chooseAfterValueNew[0] +
                              "-" +
                              chooseAfterValueNew[1]
                          );
                          $("#type").val(1);
                          layer.close(index);
                          return false;
                        }
                      },
                    });
                  } else if (flagg == 2) {
                    $("#meetingTime").html();
                    layer.open({
                      title: "",
                      type: 1,
                      fix: false,
                      skin: "layui-layer-rim",
                      // 加上边框
                      area: ["45%", "52%"],
                      // 宽高
                      content: $("#outChangeTimeForm").html(),
                      success: function (layero, index) {
                        $.ajax({
                          type: "GET",
                          async: true, //异步执行
                          url: base_url + "/meeting/offlineMeetings/" + value,
                          headers: {
                            Accept: "application/json; charset=utf-8",
                            Authorization: layui.sessionData("userToken").key,
                          },
                          success: function (data) {
                            if (data.type == "success") {
                              $("#changeAddress").empty();
                              result = data.data;
                              $.each(data.data, function (index, item) {
                                console.log(index);
                                $("#changeAddress").append(new Option(index));
                              });
                              form.on(
                                "select(changeAddressFilter)",
                                renderDatePick($("#changeAddress").val())
                              );
                              form.on(
                                "select(changeAddressFilter)",
                                function (data) {
                                  renderDatePick(data.value);
                                }
                              );
                              form.render("select");
                            }
                            $(".changeTimeAdd").show();
                          },
                        });
                        element.on("tab(onChangeAddress)", function (data) {
                          onChangeAddressIndex = data.index;
                          changeAdderess(onChangeAddressIndex);
                        });
                      },
                      cancel: function (index, layero) {
                        changeAdderess(onChangeAddressIndex);
                        layer.close(index);
                        return false;
                      },
                    });
                  }
                },
              });
              var onChangeAddressIndex = "";
              function changeAdderess(onChangeAddressIndex) {
                if (onChangeAddressIndex === 1) {
                  form.on("select(changeAddressN)", function (data) {
                    $("#meetAdderss").val(data.value);
                  });
                  renderData();
                  $("#type").val(3);
                } else {
                  var chooseAfterValueNew = indexItem.sort((a, b) => {
                    return a > b ? 1 : -1;
                  });
                  console.log(chooseAfterValueNew);
                  if (chooseAfterValueNew.length == 0) {
                    $("#meetingTime").html(
                      $("#changeAddress option:selected").val()
                    );
                  } else {
                    $("#meetingTime").html(
                      chooseAfterValueNew[0] +
                        "-" +
                        chooseAfterValueNew[1] +
                        " " +
                        $("#changeAddress option:selected").val()
                    );
                  }

                  $("#meetAdderss").val($("#changeAddress").text().trim());
                  $("#type").val(2);
                }
              }

              //周六周日不可选
              function disabled_date(value, appointmentDate) {
                var mm = value.year + "-" + value.month + "-" + value.date;
                $(".laydate-theme-grid table tbody")
                  .find('[lay-ymd="' + mm + '"]')
                  .removeClass("layui-this");
                if (appointmentDate != null && appointmentDate != "") {
                  var dates = appointmentDate.split(",");
                  for (var i = 0; i < dates.length; i++) {
                    if (dates[i] == "7") {
                      dates[i] = 0;
                    }
                    $("table>tbody>tr")
                      .find("td:eq(" + dates[i] + ")")
                      .addClass("laydate-disabled");
                  }
                }
              }
            }
          }
        );
    </script>
  </body>
</html>
